package nxu.it.movieapi.service.pg.dao;

import nxu.it.api.model.CastRole;
import nxu.it.movieapi.service.pg.entity.CastEntity;
import nxu.it.movieapi.service.pg.entity.FilmographyEntity;
import org.seasar.doma.Dao;
import org.seasar.doma.Select;
import org.seasar.doma.boot.ConfigAutowireable;

import java.util.List;

@Dao
@ConfigAutowireable
public interface MovieCastDao {
    @Select
    List<CastEntity> findCastByMovieId(Integer movieId);


    @Select
    List<CastEntity> findCastByMovieIdAndRole(Integer movieId, CastRole role);

    @Select
    List<FilmographyEntity> findMoviesByStaffIdAndRole(Integer staffId, CastRole role);

    @Select
    List<FilmographyEntity> findMoviesByStaffId(Integer staffId);

    @Select
    List<CastEntity> findActorsByMovieId(Integer movieId);

    @Select
    List<FilmographyEntity> findActedMoviesByStaffId(Integer staffId);

    @Select
    List<FilmographyEntity> findDirectedMoviesByStaffId(Integer staffId);
}
